package edu.sctu.practice.class01.wulixia.momth12_wlx.assign05.three;

/**
 * Created by wulixia.
 */
public class Sort2or3 {
    double max1,max2,max3;

    Sort2or3(){
        max1=-1;
        max2=-1;
        max3=-1;
    }

    void sort(double i,double j){
        double s;
        max1=i;
        max2=j;

        if(max1<max2){
            s=max1;max1=max2;max2=s;
        }
    }

    void sort(double i,double j,double k){
        double s;
        max1=i;
        max2=j;
        max3=k;

        if (max1<max2){
            s=max1;max1=max2;max2=s;
        }
        if (max1<max3){
            s=max1;max1=max3;max3=s;
        }
        if (max2<max3){
            s=max2;max2=max3;max3=s;
        }
    }

}
